#!/usr/bin/env ruby

require 'net/http'
require 'uri'

targets = %w{http://neocoin.net/cs/NeoCoin/Journal  http://redmine.neocoin.net/login http://neocoin.net/cs/CenterStage}
#targets.each{|x|  Net::HTTP.get URI.parse(x)}

puts Time.now.strftime('[%a %b %d %H:%M:%S %Z %Y]')
code_to_obj = Net::HTTPResponse::CODE_TO_OBJ
targets.each do |target|
  url = URI.parse(target)
  req = Net::HTTP::Get.new(url.path)
  Net::HTTP.start(url.host, url.port) {|http|
    res =  http.request(req)
    puts "#{res.code}\t#{code_to_obj[res.code]}\t#{target}"
  }
end
